home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / aspipat.zip / SCSI.H < prev    next >
C/C++ Source or Header  |  1992-01-26  |  5KB  |  146 lines

  1. #ident "$Id: scsi.h,v 1.4 1991/05/06 00:05:01 chris Exp $"
  2.  
  3. /*
  4.  $Log: scsi.h,v $
  5.  * Revision 1.4  1991/05/06  00:05:01  chris
  6.  * Add defines for the direction flags.
  7.  * Add the sense parameter to all prototypes
  8.  * Add the prototype for the SCSIGeneric() function
  9.  *
  10.  * Revision 1.3  1991/03/21  11:10:18  chris
  11.  * moved all errormessage defines to the new header file scsierr.h
  12.  *
  13.  * Revision 1.2  1991/03/04  16:52:18  chris
  14.  * Changes made to prototypes to implement as DLL
  15.  *
  16.  * Revision 1.1  1991/03/04  01:19:22  chris
  17.  * Initial revision
  18.  *
  19.  */
  20.  
  21. static char *scsi_h_id = "$Id: scsi.h,v 1.4 1991/05/06 00:05:01 chris Exp $";
  22.  
  23.  
  24. #pragma pack(1)
  25.  
  26. typedef struct _ainquiry {
  27.   int   adapter_num;
  28.   int   adapters;
  29.   int   target_id;
  30.   char  manager_id[17];
  31.   char  adapter_id[17];
  32. } aspiinquiry;
  33.  
  34. typedef struct _sinquiry {
  35.   unsigned per_type : 5;
  36.   unsigned per_qualify : 3;
  37.   unsigned dev_qualify : 7;
  38.   unsigned rbm : 1;
  39.   unsigned ansi_ver : 3;
  40.   unsigned ecma_ver : 3;
  41.   unsigned iso_ver : 2;
  42.   unsigned response_fmt : 4;
  43.   unsigned _reserved1 : 3;
  44.   unsigned anec : 1;
  45.   unsigned len : 8;
  46.   unsigned _reserved2 : 8;
  47.   unsigned _reserved3 : 8;
  48.   unsigned _reserved4 : 1;
  49.   unsigned cmd_que : 1;
  50.   unsigned cache : 1;
  51.   unsigned linked : 1;
  52.   unsigned sync : 1;
  53.   unsigned bus16 : 1;
  54.   unsigned bus32 : 1;
  55.   unsigned reladr : 1;
  56.   char vendor_id[8];
  57.   char product_id[16];
  58.   char revision[4];
  59.   unsigned char vendor[20];
  60.   unsigned char _reserved5[40];
  61. } scsiinquiry;
  62.  
  63. typedef struct _capacity  {
  64.   DWORD blocks;
  65.   DWORD block_len;
  66. } capacity;
  67.  
  68. typedef struct _blocklimit  {
  69.   DWORD max;
  70.   DWORD min;
  71. } blocklimit;
  72.  
  73.  
  74. /*
  75.  * The direction flags for use with the SCSIGeneric() command
  76.  * These flags are also defined in ada.h for the AdaGeneric() command
  77.  */
  78.  
  79. #ifndef _DIR_FLAGS_
  80. #define _DIR_FLAGS_
  81. #define DIR_NOT_CHECKED 0
  82. #define DIR_INPUT 1
  83. #define DIR_OUTPUT 2
  84. #define DIR_NO_TRANSFER 3
  85. #endif
  86.  
  87. /*
  88.  * Function prototypes:
  89.  */
  90. int HostAdapterInquiry(struct _ainquiry *inq);
  91. int GetDeviceTyp(int adapter, int target_id, int lun);
  92. int SCSIInquiry(int adapter, int target_id, int lun,
  93.                         struct _sinquiry far *inq, unsigned char *sense);
  94. int SCSIResetDevice(int adapter, int target_id, int lun);
  95. int SCSIReadCapacity(int adapter, int target_id, int lun,
  96.                      struct _capacity *cap, unsigned char *sense);
  97. int SCSISeekRead(int adapter, int target_id, int lun, unsigned long buf,
  98.                  unsigned long len, unsigned long blockadr, int l2bf,
  99.                  unsigned char *sense);
  100. int SCSIReZeroUnit(int adapter, int target_id, int lun, unsigned char *sense);
  101. int SCSIStartStop(int adapter, int target_id, int lun,
  102.                           int start, int eject, unsigned char *sense);
  103. int SCSISeekWrite(int adapter, int target_id, int lun,
  104.                  unsigned long buf, unsigned long len,
  105.                  unsigned long blockadr, int l2bf,
  106.                              unsigned char *sense);
  107. int SCSISeekWriteVerify(int adapter, int target_id, int lun,
  108.                    unsigned long buf, unsigned long len,
  109.                    unsigned long blockadr, int l2bf, 
  110.                                    int bcheck, unsigned char *sense);
  111. int SCSISeek(int adapter, int target_id, int lun,
  112.                         unsigned long blockadr, unsigned char *sense);
  113. int SCSIFormatUnit(int adapter, int target_id, int lun,
  114.                               int interleave, unsigned char *sense);
  115. int SCSIAllowRemoval(int adapter, int target_id, int lun,
  116.                                 int prevent, unsigned char *sense);
  117. int SCSIErase(int adapter, int target_id, int lun, int immediate,
  118.                          int lng, unsigned char *sense);
  119. int SCSILoad(int adapter, int target_id, int lun, int immediate,
  120.             int load, int retention, int eot,
  121.                         unsigned char *sense);
  122. int SCSIRead(int adapter, int target_id, int lun,
  123.                         char far* buf, unsigned long len, int l2bf,
  124.                         int sili, int fixed, unsigned char *sense);
  125. int SCSIReadBlockLimits(int adapter, int target_id, int lun,
  126.                                    struct _blocklimit *lim,
  127.                                    unsigned char *sense);
  128. int SCSIReleaseUnit(int adapter, int target_id, int lun,
  129.                                unsigned char *sense);
  130. int SCSIReserveUnit(int adapter, int target_id, int lun,
  131.                                unsigned char *sense);
  132. int SCSIRewind(int adapter, int target_id, int lun, int immediate,
  133.                           unsigned char *sense);
  134. int SCSISpace(int adapter, int target_id, int lun, int code,
  135.                          long count, unsigned char *sense);
  136. int SCSIWrite(int adapter, int target_id, int lun,
  137.                          char far *buf, unsigned long len,
  138.                          int l2bf, int fixed, unsigned char *sense);
  139. int SCSIWriteFilemarks(int adapter, int target_id, int lun,
  140.                   unsigned long len, int setmark,
  141.                                   int immediate, unsigned char *sense);
  142. int SCSIGeneric(int adapter, int target_id, int lun,
  143.                            unsigned char *ccb, int ccblength,
  144.                            unsigned char *sense, int senselength,
  145.                DWORD data, DWORD datalength, int direction);
  146.